package com.vehicle.admin.web.common.freemarker;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.view.freemarker.FreeMarkerView;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by yantingbin on 2017/8/30.
 */
public class FreeMarkerViewExtend extends FreeMarkerView {
    private static final Logger LOGGER= LoggerFactory.getLogger(FreeMarkerViewExtend.class);

    @Override
    protected void exposeHelpers(Map<String,Object> model, HttpServletRequest request){
        try {
            super.exposeHelpers(model,request);
        } catch (Exception e) {
            LOGGER.error("freemarkerviewextend loaded parent class exception ",e);
        }
        model.put("_time",System.currentTimeMillis());
        model.put("ctx",request.getContextPath());
    }
}
